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