UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '19EZ0p1XsmHXbjTEv8bKiCE77bfv69f2CVLDS3jdf9Y='
WHERE
key_id = 'aadae3b91070eeba0d001971222e82d6c2af96f7f9f82ff8001c4ebcbb27ac7c'
AND (
token = '19EZ0p1XsmHXbjTEv8bKiCE77bfv69f2CVLDS3jdf9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)