UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oSgyRfK/Ep4rR36MkzyMbB4T8fLh1Aye4U+0+8yM2MM='
WHERE
key_id = 'f153e67604c544f0cbaaa565fd84d925e24072a8e41d33448aab9b209b616a93'
AND (
token = 'oSgyRfK/Ep4rR36MkzyMbB4T8fLh1Aye4U+0+8yM2MM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)