UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jQrJEhZoePAWVNf7uYqsQ0+4lvNQne5l5u7wanJcVNI='
WHERE
key_id = '502b03153e33fd3a86ca8cf4036e91761d64e97bd07cdcb6c6090002c078bd43'
AND (
token = 'jQrJEhZoePAWVNf7uYqsQ0+4lvNQne5l5u7wanJcVNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)