UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l1lPo5B05ZyryX3UZ8TWNI9Q4OWGQvXCwZ0hCfhZBLs='
WHERE
key_id = '79df8b3819eaaa8806b9608310640c51e5961779718e42fc0d2fbcfcf5e299b4'
AND (
token = 'l1lPo5B05ZyryX3UZ8TWNI9Q4OWGQvXCwZ0hCfhZBLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)