UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sjQwpmjGOeNOWn0GEVPS1+BQ3nJ/lmG0Aax7BWX/kPg='
WHERE
key_id = 'aba9663c7f18fab183452e091ced9a9bcb3233c1a8411e7a101f4bccceea66ea'
AND (
token = 'sjQwpmjGOeNOWn0GEVPS1+BQ3nJ/lmG0Aax7BWX/kPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)