UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uZLJtPB0ZTutHJIPuP8BNUwVWHOkfvU+8YbiSU9Vhr4='
WHERE
key_id = '1f3e56c78f44a882ffc284b70eda168c768706ae2d08b4f9bcea71db7ea2f027'
AND (
token = 'uZLJtPB0ZTutHJIPuP8BNUwVWHOkfvU+8YbiSU9Vhr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)