UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3381htZ8pP3zaWIyZiH+Ce+SgjxCsEh7JF74pBZ7D34='
WHERE
key_id = '95dc6fd59bcc3272c3c920ca41c9323af88f2a35ec809aecf3da756527d1af28'
AND (
token = '3381htZ8pP3zaWIyZiH+Ce+SgjxCsEh7JF74pBZ7D34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)