UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IPAarHAjb/SHqXvJ9snDoxFE7JbNqj6aaHOOUIwKdHY='
WHERE
key_id = 'd0e059f1753c59685804d6acab09f018736d22675c5b9ee3ad92f933378656f8'
AND (
token = 'IPAarHAjb/SHqXvJ9snDoxFE7JbNqj6aaHOOUIwKdHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)