UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1CV6jvzQsSlSMLTQYaG5sfTGdxRRe9rzNx8/Q2CU3ME='
WHERE
key_id = '0bfa5b254609903ef18878797ffd1ad069b8d79491b6295b83424a4b1365f879'
AND (
token = '1CV6jvzQsSlSMLTQYaG5sfTGdxRRe9rzNx8/Q2CU3ME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)