UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wfmd0tHa+87yMTfyumyuqX4JJ+1qJlx4IrLZpIFuDOg=' 
WHERE 
  key_id = '3d8abe35ac8a0cf8504beab2eceea4f2610ad70c942d52c48b358caaab418aa3' 
  AND (
    token = 'wfmd0tHa+87yMTfyumyuqX4JJ+1qJlx4IrLZpIFuDOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022