UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v+iqEug1OghM+4xBG11kxpyY+YAcqHHRp4O/bO1mIqo='
WHERE
key_id = '186887099e6bdf28cddeea946dab88ac990f5ddb0c674caea750a846b64de80e'
AND (
token = 'v+iqEug1OghM+4xBG11kxpyY+YAcqHHRp4O/bO1mIqo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)