UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z/ptU6VaimPUOVb0uao/wrU7YdyuhVGJnZddwHLEhqU=' 
WHERE 
  key_id = '9b52f52db1dc72069301a5ee8b7f38ba634469ced5b5dec0b5bbcdd62ff050db' 
  AND (
    token = 'z/ptU6VaimPUOVb0uao/wrU7YdyuhVGJnZddwHLEhqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025