UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RHOvRxrLq1u/fhTxFInvWV7Ej1fia+rAOcw+MWRbphU='
WHERE
key_id = '03e04bd1b2a37bcab9259fe2a5595ace4ed68314f74d40fa4b157aba30267693'
AND (
token = 'RHOvRxrLq1u/fhTxFInvWV7Ej1fia+rAOcw+MWRbphU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)