UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rug5SWhHKbwifYjOuJDB3uQJhIhEPF2axl/JtjTFcO0='
WHERE
key_id = '2728a66399c73fb18ff7d5cf312eb0e9de8398ec14c2ae9ac85404893758fe12'
AND (
token = 'Rug5SWhHKbwifYjOuJDB3uQJhIhEPF2axl/JtjTFcO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)