UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7MB5oxesvSWTmjK0mO6PzPvjS0jjAb1wn7eV2+Rby0s='
WHERE
key_id = 'bf998df16e9b8dafc6fa3f9c0b833ebb0ad759f77ff9925edc80881fb6323adb'
AND (
token = '7MB5oxesvSWTmjK0mO6PzPvjS0jjAb1wn7eV2+Rby0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)