UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CiGispCViVxORosPfrVzBcMfRHeLsAuUYDRGBYQwE70='
WHERE
key_id = '072c48e811c00bafe988d0bebc4c656ff513a4134f1d8552dc7ae649bdcabdad'
AND (
token = 'CiGispCViVxORosPfrVzBcMfRHeLsAuUYDRGBYQwE70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)