UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '88ne8HotQnBO6420pSo4fX4A50ZlZOt9TqTNIvGt/Kw='
WHERE
key_id = 'ded4482a9077d80427b79b222baba36733c2a798447bf1fbb740b59f44a317da'
AND (
token = '88ne8HotQnBO6420pSo4fX4A50ZlZOt9TqTNIvGt/Kw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)