UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ELhxSHNvL8xYKrvZ6sfDYgGUuu02AXZOd41Zlypl4vA='
WHERE
key_id = '4b3138394e51d89897a171afd0bdb674dd178e64e13b6586de50a475d9faf847'
AND (
token = 'ELhxSHNvL8xYKrvZ6sfDYgGUuu02AXZOd41Zlypl4vA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)