UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w88HQVAozYSdbxW03d6Dbl/cUpR5lQMvzhqwQZsnazQ='
WHERE
key_id = 'bba3fcf77fbff7dfde58fd01bf2c2cfbc3e4c346de22195b20e59a958aee5e05'
AND (
token = 'w88HQVAozYSdbxW03d6Dbl/cUpR5lQMvzhqwQZsnazQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)