UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GGx4LRs9H9EJbaVXqDcJqY4yV6JZrYfkyBj5ohPTu28='
WHERE
key_id = 'd8cc3f0e75e8beef9236cf5848f974261f786891db1aeebcccfa24a28d657bf4'
AND (
token = 'GGx4LRs9H9EJbaVXqDcJqY4yV6JZrYfkyBj5ohPTu28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)