UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sxd2+l3oqPK5hwNkSC1cvcNC6tucoW/YJpKBmt2XaaU='
WHERE
key_id = 'f3a0b03cc1bb544ec0cbddd49c348db5f48e4fe9529c6fe57e4b2ad004ca58d6'
AND (
token = 'Sxd2+l3oqPK5hwNkSC1cvcNC6tucoW/YJpKBmt2XaaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)