UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tTLNfwkBIK2IMVNp6UrwrT58ZD6R5JEO2L6M2MXc19A='
WHERE
key_id = 'daea9ade3fc3d6e25850b250399a1b8d3a0751b5d68c471474018531c14ddcec'
AND (
token = 'tTLNfwkBIK2IMVNp6UrwrT58ZD6R5JEO2L6M2MXc19A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)