UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C1vlYHWW32Aw4HwMrXVELSb4ncKRgg+o0v8mQFC+/OE='
WHERE
key_id = '3155974ead8ec652e087db592adb85c3744fc4e1d4eaa5803d4419e66bd5ed03'
AND (
token = 'C1vlYHWW32Aw4HwMrXVELSb4ncKRgg+o0v8mQFC+/OE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)