UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rYJ4DVDFTCOHQICgxahXi1RT22ZcgA7g0Np5A/ppdxY='
WHERE
key_id = '69e63f1a2a81fcf33736dcfe797933839b516ae4f27574d47e38f1db3ef325e1'
AND (
token = 'rYJ4DVDFTCOHQICgxahXi1RT22ZcgA7g0Np5A/ppdxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)