UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yOJSi83kesyhvmJF3ypPgj7qBJXFIr6PCoTFRkYhM/A='
WHERE
key_id = 'b9ed5b83a3cebf2413ae16e59e811f403c25638ec75bad66d82b53b85bf119da'
AND (
token = 'yOJSi83kesyhvmJF3ypPgj7qBJXFIr6PCoTFRkYhM/A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)