UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hGPy0PVJCxntsjy3W/F+0uWZ0HdGpsxa6ZuvF+SAbCs='
WHERE
key_id = 'c9168f885b5e17c0b3cac92ec0e5f8b6fd1fc33174539d289d5bfde51b59830e'
AND (
token = 'hGPy0PVJCxntsjy3W/F+0uWZ0HdGpsxa6ZuvF+SAbCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)