UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/1WmtmlFMD15caCeVqBX1GEppAwzNYagm0ALha42++k='
WHERE
key_id = 'cfcb05ab89a46a99307bf6be625e8dea5d8a714720a6f77a57092892f2d42286'
AND (
token = '/1WmtmlFMD15caCeVqBX1GEppAwzNYagm0ALha42++k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)