UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3y3oMMh4kuvhNe8aAF2uTzZly79Ec5zNIi5jY6J3E1I='
WHERE
key_id = '74f86e35e3224dadccf53589618ec3a2de19fd41d546e7fae405fc4737152c50'
AND (
token = '3y3oMMh4kuvhNe8aAF2uTzZly79Ec5zNIi5jY6J3E1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)