UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6VJ9QVp2WSJOy++WCfPVTnYQM/keugXgU/YoLjUWzE0='
WHERE
key_id = '68fd21b2e57af901a5a4d4bd4903da1dcd5926632c3087e51c2a2a1373724985'
AND (
token = '6VJ9QVp2WSJOy++WCfPVTnYQM/keugXgU/YoLjUWzE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)